<%-- 
    Document   : Header
    Created on : Nov 5, 2012, 2:02:42 PM
    Author     : DAT
--%>

<%@page import="dao.SanPhamDAO"%>
<%@page import="pojo.SanPham"%>
<%@page import="dao.LoaiSanPhamDAO"%>
<%@page import="pojo.LoaiSanPham"%>
<%@page import="dao.ThuongHieuDAO"%>
<%@page import="pojo.ThuongHieu"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%
    String maThuongHieu = "1";
    List<ThuongHieu> list = ThuongHieuDAO.layDanhSach();
    List<LoaiSanPham> dsLoaiSP = LoaiSanPhamDAO.layDanhSachLoaiSanPham();
    List<SanPham> dsSP = SanPhamDAO.layDanhSachSanPham();

%>
<table width="1034" height="250" align="center" border="1" bordercolor="#FFFFFF">
    <tr align="center">
        <td colspan="5" valign="middle"><img src="images/BannerShoes.gif" width="1024" height="247"/></td>
    </tr>
    <tr>
        <td width="200" align="center"><a href="Model3_TrangChu.jsp"><img src="images/Button-Trangchu.gif" width="179" height="48"/></a></td>
        <td width="200" align="center"><a href="TrangDangKy"><img src="images/Button-Nam.gif" width="179" height="48"/></a></td>
        <td width="200" align="center"><a href="TrangChu"><img src="images/Button-Nu.gif" width="179" height="48"/></a></td>
        <td width="200" align="center"><a href="TrangChu"><img src="images/Button-Treem.gif" width="179" height="48"/></a></td>
        <td width="200" align="center"><a href="TrangChu"><img src="images/Button-Gioithieu.gif" width="179" height="48"/></a></td>
    </tr>
    <tr align="center">
    <form action="TimKiem.jsp">
        <td colspan="5">
            <p align="right"><font color="#0066FF"><strong>Tìm kiếm theo:</strong></font>

                <select name="thuongHieu" size="1" style="width:15%">
                    <option value="1" selected="selected">--Chọn thương hiệu--</option>
                    <%
                        for (int i = 0; i < list.size(); i++) {
                            ThuongHieu thuongHieu = list.get(i);
                    %>
                    <option value="<%=thuongHieu.getMaThuongHieu()%>"><%=thuongHieu.getTenThuongHieu()%></option>
                    <%}
                        if (request.getParameter("thuongHieu") != null) {
                            maThuongHieu = request.getParameter("thuongHieu");
                        }
                    %>
                </select>

                <select name="loaiSanPham" style="width:15%">
                    <option value="Tất cả" selected="selected">--Chọn loại--</option>
                    <%
                        for (int i = 0; i < dsLoaiSP.size(); i++) {
                            LoaiSanPham loaiSanPham = dsLoaiSP.get(i);
                    %>
                    <option value="<%= loaiSanPham.getMaLoaiSanPham()%>"><%=loaiSanPham.getTenLoaiSanPham()%></option>
                    <% }
                        String maLoai = "L001";
                        if (request.getParameter("loaiSanPham") != null) {
                            maLoai = request.getParameter("loaiSanPham");
                        }
                    %>
                </select>

                <select name="kichCo" style="width:15%">
                    <option value="1" selected="selected">--Chọn kích cỡ--</option>
                    <%
                        for (int i = 0; i < dsSP.size(); i++) {
                            SanPham sp = dsSP.get(i);
                    %>
                    <option value=<%= sp.getSize()%> ><%= sp.getSize()%></option>
                    <% }
                        String size = "1";
                        if (request.getParameter("kichCo") != null) {
                            size = request.getParameter("kichCo");
                        }
                    %>
                </select>

                <select name="giaBan" style="width:15%">
                    <option value="Tất cả" selected="selected">--Chọn giá--</option>
                    <option value="150">&lt; 150,000</option>
                    <option >150,000 - 250,000</option>
                    <option>250,000 -500,000</option>
                    <option>&gt; 500,000</option>
                </select>

                <input type="submit" value="Tìm kiếm" name="timKiem"  >

                </input>           
            </p>
            <!--ket thuc tim kiem-->
        </td>
    </form>
</tr>
</table>
